home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / malloc_.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  2.0 KB  |  58 lines

  1. /* Copyright (C) 1989, 1992, 1996, 1998 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: malloc_.h,v 1.2 2000/09/19 19:00:47 lpd Exp $ */
  20. /* Generic substitute for Unix malloc.h */
  21.  
  22. #ifndef malloc__INCLUDED
  23. #  define malloc__INCLUDED
  24.  
  25. /* We must include std.h before any file that includes sys/types.h. */
  26. #include "std.h"
  27.  
  28. #ifdef __TURBOC__
  29. #  include <alloc.h>
  30. #else
  31. #  if defined(BSD4_2) || defined(apollo) || defined(vax) || defined(sequent) || defined(UTEK)
  32. #    if defined(_POSIX_SOURCE) || (defined(__STDC__) && (!defined(sun) || defined(__svr4__)))    /* >>> */
  33. #      include <stdlib.h>
  34. #    else            /* Ancient breakage */
  35. extern char *malloc();
  36. extern void free();
  37.  
  38. #    endif
  39. #  else
  40. #    if defined(_HPUX_SOURCE) || defined(__CONVEX__) || defined(__convex__) || defined(__OSF__) || defined(__386BSD__) || defined(_POSIX_SOURCE) || defined(__STDC__) || defined(VMS)
  41. #      include <stdlib.h>
  42. #    else
  43. #      include <malloc.h>
  44. #    endif            /* !_HPUX_SOURCE, ... */
  45. #  endif            /* !BSD4_2, ... */
  46. #endif /* !__TURBOC__ */
  47.  
  48. /* (At least some versions of) Linux don't have a working realloc.... */
  49. #ifdef linux
  50. #  define malloc__need_realloc
  51. void *gs_realloc(P3(void *, size_t, size_t));
  52.  
  53. #else
  54. #  define gs_realloc(ptr, old_size, new_size) realloc(ptr, new_size)
  55. #endif
  56.  
  57. #endif /* malloc__INCLUDED */
  58.